package com.dnjn.happiness.system.api;

import com.dnjn.happiness.common.core.constant.SecurityConstants;
import com.dnjn.happiness.common.core.constant.ServiceNameConstants;
import com.dnjn.happiness.common.core.domain.R;
import com.dnjn.happiness.system.api.domain.SysRole;
import com.dnjn.happiness.system.api.factory.RemoteRoleFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;
import java.util.Set;

@FeignClient(contextId = "remoteRoleService",value = ServiceNameConstants.SYSTEM_SERVICE,fallbackFactory = RemoteRoleFallbackFactory.class)
public interface RemoteRoleService {

    @GetMapping("/role/queryRole/{userId}")
    public R<List<SysRole>> queryRole(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/role/selectRolePermissionByUserId/{userId}")
    public R<List<SysRole>> selectRolePermissionByUserId(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
